@import '~scss/variables';

.icon {
  display: block;
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;

  &::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
  }

  &.draft,
  &.pending-review,
  &.creating {
    background-color: rgba(36, 46, 66, 0.1);
    box-shadow: 0 8px 16px 0 rgba(36, 46, 66, 0.06);

    &::before {
      background-color: $blue-color03;
    }
  }

  &.success,
  &.succeeded,
  &.successful,
  &.ready,
  &.running,
  &.jobrunning,
  &.active,
  &.normal,
  &.bound,
  &.available,
  &.healthy,
  &.passed {
    background-color: rgba(85, 188, 138, 0.1);
    box-shadow: 0 8px 16px 0 rgba(85, 188, 138, 0.36);

    &::before {
      background-color: $green;
    }
  }

  &.jobrunning {
    &.flicker {
      animation: flicker 1.5s linear infinite;
    }
  }

  &.updating,
  &.upgrading,
  &.building,
  &.notrunning,
  &.warning,
  &.waiting,
  &.terminating,
  &.released,
  &.unfinished,
  &.major,
  &.deleting,
  &.in-review {
    background-color: rgba(245, 196, 20, 0.1);
    box-shadow: 0 8px 16px 0 rgba(245, 196, 20, 0.36);

    &.flicker {
      animation: flicker 1.5s linear infinite;
    }

    &::before {
      background-color: $yellow-dark;
    }
  }

  &.deleted,
  &.error,
  &.lost,
  &.unschedulable,
  &.failed,
  &.critical,
  &.rejected,
  &.ceasing {
    background-color: rgba(202, 38, 33, 0.1);
    box-shadow: 0 8px 16px 0 rgba(202, 38, 33, 0.2);
    &::before {
      background-color: $red-dark;
    }
  }

  &.stopped,
  &.disabled,
  &.pending,
  &.unknown,
  &.draining,
  &.terminated,
  &.completed,
  &.minor,
  &.paused,
  &.suspended {
    background-color: rgba(134, 146, 157, 0.1);
    &::before {
      background-color: #86929d;
    }
  }
}

@keyframes flicker {
  0% {
    transform: scale(0.7);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.7);
    opacity: 0.2;
  }
}
